<?php

if( ! defined('DOCROOT') )
{
    require_once '/var/www/advancelab/chilik2/unittest/bootstrap.php';
}

class ResultCacheTest extends UnitTestCase
{
    function testingResultCacheTest()
    {
        $struct = new Entity\ResultCache();
        
        $this->assertIdentical($struct,new Entity\ResultCache);
        $this->assertTrue($struct instanceof Entity\ResultCache);
        
        $struct->vary = 'php';
        $this->assertEqual( 'php', $struct->vary );
        $struct->expire = 'ezc';
        $this->assertEqual( 'ezc', $struct->expire );
        $struct->controls = 'ezp';
        $this->assertEqual( 'ezp', $struct->controls );
        $struct->pragma = 'buddymiles';
        $this->assertEqual( 'buddymiles', $struct->pragma );
        $struct->lastModified = 'buddyguy';
        $this->assertEqual( 'buddyguy', $struct->lastModified );
        
        /* $this->dump($struct); */
    }
    
    public function testMockingMethod()
    {
        $state = array(
        'vary' => 'php',
        'expire' => 'ezc',
        'controls' => 'ezp',
        'pragma' => 'buddymiles',
        'lastModified' => 'buddyguy',
        );
        
        $struct = Entity\ResultCache::__mock( $state );
        
        $this->assertEqual( 'php', $struct->vary );
        $this->assertEqual( 'ezc', $struct->expire );
        $this->assertEqual( 'ezp', $struct->controls );
        $this->assertEqual( 'buddymiles', $struct->pragma );
        $this->assertEqual( 'buddyguy', $struct->lastModified );
    }
    
}
